<!DOCTYPE html>
<html>
{include file="head.html"}
<body>
<div class="header" > <a  class="left-btn pointer" href="{$appkucun}?m=product"><span class="iconfont icon-back"></span></a>
  <div class="title">产品管理</div>
  <a class="right-btn" href="{$appkucun}?m=product&a=add">添加</a> </div>
<div class="rbox">
  <ul class="tabs-border"   id="myTab" style="margin-top:10px; margin-bottom:10px;">
    <li class="active item"><a href="#p_base"  data-toggle="tab" >基本信息</a></li>
    <li class="item"><a href="#p_other"  data-toggle="tab" >扩展信息</a></li>
    <li class="item"><a href="#p_cuxiao" data-toggle="tab">促销组合</a></li>
  </ul>
  <form method="post" action="{$appadmin}?m=product&a=save">
    <input type="hidden" name="id" value="{$data.id}" />
    <div class="tab-content">
      <div class="tab-pane active" id="p_base">
        <div class="input-row">
          <input name="title" type="text" id="title" value="{$data.title}" size="80">
          <label>产品名称</label>
        </div>
        <div class="input-row">
          <label>货号</label>
          <input type="text" name="goodsno" value="{$data.goodsno}" />
        </div>
        <div class="input-row">
          
          <select name="catid" id="catid" class="txt w98">
            <option value="0">请选择产品分类</option>
            
    {foreach item=c from=$cat_list}
                
            <option value="{$c.catid}" {if $data.catid eq $c.catid} selected="selected"{/if}>{$c.cname}</option>
            
                {foreach item=c_2 from=$c.child}
                	
            <option value="{$c_2.catid}" {if $data.catid eq $c_2.catid} selected="selected"{/if} class="o_c_2">|__{$c_2.cname}</option>
            
                    {foreach item=c_3 from=$c_2.child}
                    
            <option value="{$c_3.catid}" {if $data.catid eq $c_3.catid} selected="selected"{/if} class="o_c_3"> |____{$c_3.cname}</option>
            
                    {/foreach}
                {/foreach}
                {/foreach}
    
          </select>
        </div>
        <div class="input-row">
          <div id="up1" url="/index.php?m=upload&a=uploadtao&dir=product&tablename=product&id={$data.id}">
            <div class="btn-upload">
              <input type="file" name="upimg" id="ud"  class="btn-upload-file" onChange="uploadimg('up1')">
            </div>
            <input type="hidden" name="imgurl" class="imgurl" value="{$data.imgurl}">
            <span class="imgShow"> {if $data.imgurl} <img src="{$data.imgurl|images_site}.100x100.jpg"> {/if} </span> </div>
        </div>
        <div class="textarea-row">
          <label>描述</label>
          <textarea name="description" id="description" class="w600 h40">{$data.description}</textarea>
        </div>
      </div>
      
      <!--扩展信息-->
      <div class="tab-pane active" id="p_other">
        <div class="input-row">
          <label>价格</label>
          <input type="text" name="price" value="{$data.price}" />
        </div>
        <div class="input-row">
          <label>市场价：</label>
          <input type="text" name="market_price" value="{$data.market_price}" />
        </div>
        <div class="input-row">
          <label>库存数量：</label>
          <input type="text" name="total_num" value="{$data.total_num}" />
        </div>
        <div class="input-row">
          <label>Kg</label>
          <input type="text" name="weight" value="{$data.weight}" />
        </div>
        <div class="input-row">
          <td class="txt">销售数：{$data.buy_num}</td>
        </div>
         
      </div>
      <!--End 扩展信息-->
      
      <div class="tab-pane active" id="p_cuxiao">
        <div class="input-row">
          <label>促销价：</label>
          <input type="text" name="lower_price" value="{$data.lower_price}" />
        </div>
        <div class="input-row">
          <label>开始时间</label>
          <input type='text' name='starttime' id='starttime' value='{if $data.starttime}{$data.starttime|date:Y-m-d H:m:s}{/if}' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" >
        </div>
        <div class="input-row">
          <label>结束时间</label>
          <input type='text' name='endtime' id='endtime' value='{if $data.endtime}{$data.endtime|date:Y-m-d H:m:s}{/if}' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" >
        </div>
        <div class="input-row">
          <label>组合产品</label>
          <input type="text" style="width:600px;" name="zuhe_ids"  value="{$data.zuhe_ids}"/>
          
        </div>
        <div class="input-row">(格式相关产品id：1,2,3,4,5)</div>
      </div>
    </div>
    <div class="form-btns">
      <button type="submit" name="button" id="button" class="btn btn-row" >提交</button>
    </div>
  </form>
</div>
<link href="/plugin/webuploader/webuploader.css" rel="stylesheet">
<script src="/plugin/webuploader/webuploader.min.js"></script> 
<script src="/plugin/webuploader/app.js"></script> 
<script>
$(function(){
	 
 
 
 
 $('#myTab a').click(function (e) {
  e.preventDefault();
  $(this).tab('show');
})
})
 
	 
	
 
</script> 
<script language="javascript" src="/plugin/jquery/ajaxfileupload.js"></script> 
<script language="javascript" src="{const.STATIC_SITE}/static/js/upload.js"></script> 
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script> 
{include file='footer.html'}
